package com.summerbird.mallchat.transaction.service;

import java.util.Objects;

public class SecureInvokeHolder {

    public static final ThreadLocal<Boolean> INVOKED_THREAD_LOCAL = new ThreadLocal<>();

    public static boolean IS_INVOKING(){
        return Objects.nonNull(INVOKED_THREAD_LOCAL.get());
    }

    public static void setInvoking(){
        INVOKED_THREAD_LOCAL.set(Boolean.TRUE);
    }

    public static void invoked(){
        INVOKED_THREAD_LOCAL.remove();
    }
}
